'''
Created on 2013-6-26

@author: ZuoPeng
'''

import euler.fun
def p64(n):
    count = 0
    for x in range(2, n + 1):
        if x ** 0.5 > int(x ** 0.5):
            cf = euler.fun.continued_fractions(x)
            l = len(cf) - 1
            if l % 2 == 1:
                count += 1
    print(count)
p64(10000)
